---@class IMediator : LuaObject
---@field protected super IMediator
---@field protected view IBaseView
---@field protected mask FullMask
local this = BaseClass("IMediator")

function this:__ctor(view)
    self.view = view
end

---@param args userdata
function this:SetData(args)
    self.data = args
end

---@param args table
function this:Awake(args)
    self.mask = args[2]
    self.view:Awake(args[1])
    self:LogGC("Awake")
end

function this:Open()
    self.view:Open()
    self:UpdateEvent()
    self:LogGC("Open")
end

function this:Close()
    self.view:Close()
    self:UpdateEvent()
    self:LogGC("Close")
end

function this:Destroy()
    self.mask = nil
    self.data = nil
    self.view:Destroy()
    self:LogGC("Destroy")
end

function this:UpdateEvent()
    --LuaHelper.UpdateEvent(self.view.isOpen, ConstData.String.OPENED_PANEL, self.Open)
    --LuaHelper.UpdateEvent(self.view.isOpen, ConstData.String.CLOSE_PANEL, self.Close)
end

function this:PanelId()
    return PanelID.None
end

---@param funcName string
function this:LogGC(funcName)
    print(self:ClassName() .. funcName .. collectgarbage("count"))
end

IMediator = this